﻿using System;
//using System.Collections.Generic;
using System.ComponentModel;
//using System.Diagnostics;
//using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.ComponentModel;

namespace Nizm0.QOT.Library.Objects
{
    //public partial class ToolStripDateTimePicker : Component
    //{
    //    public ToolStripDateTimePicker()
    //    {
    //        InitializeComponent();
    //    }

    //    public ToolStripDateTimePicker(IContainer container)
    //    {
    //        container.Add(this);

    //        InitializeComponent();
    //    }
    //}
    public partial class ToolStripDateTimePicker : ToolStripControlHost
    {
        private readonly FlowLayoutPanel _controlPanel;
        private readonly DateTimePicker _picker = new DateTimePicker();
 
        public ToolStripDateTimePicker()
            : base(new FlowLayoutPanel())
        {
            // Set up the FlowLayouPanel.
            _controlPanel = (FlowLayoutPanel)base.Control;
            _controlPanel.BackColor = Color.Transparent;
 
            // Add two child controls.
            _picker.Format = DateTimePickerFormat.Short;
            _picker.Size = new System.Drawing.Size(85, 20);
            _controlPanel.Controls.Add(_picker);
            //base.Size.Width = 100;
        }
        [CategoryAttribute("Behavior")]
        public DateTime Value
        {
            get { return this._picker.Value; }
            set { this._picker.Value = value; }
        }
 
        protected override void OnSubscribeControlEvents(Control control)
        {
            base.OnSubscribeControlEvents(control);
 
            //Add your code here to subsribe Control Events
        }
 
        protected override void OnUnsubscribeControlEvents(Control control)
        {
            base.OnUnsubscribeControlEvents(control);
 
            //Add your code here to unsubscribe control events.
        }
 
    }
}
